package org.itzixi.controller;

import jakarta.annotation.Resource;
import org.itzixi.base.BaseInfoProperties;
import org.itzixi.utils.RedisOperator;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("g")
public class HelloController extends BaseInfoProperties {

//    @Resource
//    private RedisOperator redisOperator;
//    localhost:1000/g/hello
    @GetMapping("hello")
    public Object hello(){
        return "hello gateway";
    }

    @GetMapping("setRedis")
    public Object setRedis(String k,String v){
        redis.set(k,v);
        return "setRedis ok";
    }
    @GetMapping("getRedis")
    public Object getRedis(String k){
        return redis.get(k);
    }
}
